{extend name="public/base"}

{block name="title"}
摩邦维修店
{/block}

{block name="style"}
{css href="/static/wechat/popo/css/evaluate.css" /}
{/block}

{block name="body"}

<div class="pageControl orderDetails">
    <div class="nav">
        <div class="msui_navTop">
            <a class="msui_navTop-back" href="javascript:history.back();"><i class="micon-back_fff"></i></a>
            <h1 class="msui_navTop-title">评价</h1>
        </div>
    </div>
    <div class="weui-cell weui-cell_access evaluate" href="javascript:;">
        <div class="weui-cell__bd" id="weui_flex">
            <p class="ping_num">评价<span class="cl-9999">({$num})</span></p>
            <span>综合：{$level}</span>
            <div class="P_star">
                <p class="xingxing"><img src="/static/wechat/images/xx_{$level}.png" alt=""/></p>
            </div>
        </div>
        <div class="weui-cell__ft"></div>
    </div>
    <div class="tag">
        {volist name="labels" id="vo"}
        <p>{$vo.label}<span class="tag_nunmer">({$vo.num})</span></p>
        {/volist}
    </div>
    <div class="mtab_list-bd">

    </div>
</div>

{/block}

{block name="javascript"}
<script>
    $(function () {
        var obj = {
            'is_more' : true,
            'page' : 1,
            'url' : '{:url("get_list")}',
        };

        get_list();
        $(window).scroll( function() {
            if (($(document).height() - $(this).scrollTop() - $(this).height()<50) && obj.is_more){
                get_list();
            }
        });

        function get_list() {
            $('#loadingToast').fadeIn(100);
            obj.is_more = false;
            $.ajax({
                type : 'POST',
                url : obj.url + '?page=' + obj.page,
                data : {
                    repair_id : {$repair_id}
                },
                dataType : 'json',
                success : function (msg) {
                    $('#loadingToast').fadeOut(100);
                    if (obj.page == 1) {
                        $(".mtab_list-bd").html(msg.tpl);
                    } else {
                        $(".mtab_list-bd").append(msg.tpl);
                    }
                    // 计算是否还有更多数据
                    if ((msg.data.total - (msg.data.current_page * msg.data.per_page)) > 0) {
                        obj.is_more = true;
                    }
                    obj.page++;
                }
            });
        }
    });

</script>
{/block}